/**
 * 功能: Message class
 * @author Conan
 * @CreatedTime 2020-04-09
 */
import { Message } from 'element-ui';

/**
 * 功能: 基础 class
 * @parame:
 * @desc:
 */
class MS {
  constructor(message = '这是提示信息', type = 'success', showClose = true) {
    this.message = message
    this.type = type
    this.showClose = showClose
  }
  init() {
    Message({
      showClose: this.showClose,
      message: this.message,
      type: this.type
    });
  }
}

/**
 * 功能: 成功
 * @parame:
 * @desc:
 */
class MsSuccess extends MS{
  constructor(message = '这是提示信息', type = 'success', showClose = true) {
    super(message, type, showClose);
    this.init()
  }
}

/**
 * 功能: 信息
 * @parame:
 * @desc:
 */
class MsInfo extends MS{
  constructor(message = '这是提示信息', type = 'info', showClose = true) {
    super(message, type, showClose);
    this.init()
  }
}

/**
 * 功能: 警告
 * @parame:
 * @desc:
 */
class MsWarning extends MS{
  constructor(message = '这是提示信息', type = 'warning', showClose = true) {
    super(message, type, showClose);
    this.init()
  }
}

/**
 * 功能: 警告
 * @parame:
 * @desc:
 */
class MsError extends MS{
  constructor(message = '这是提示信息', type = 'error', showClose = true) {
    super(message, type, showClose);
    this.init()
  }
}

export {
  MsSuccess,
  MsInfo,
  MsWarning,
  MsError,
}
